#!/usr/bin/python

# gotoclass.py

import wx


class GoToClass(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size=(990, 850))
        panel = wx.Panel(self, -1)

# STATUS Bar

        self.CreateStatusBar()
        self.SetStatusText("This is the statusbar")

# Menu
     
#FILE MENU ITEMS
        filemenu = wx.Menu()
        filemenu.Append( -1, "About",
                    "More information about this program")
        filemenu.AppendSeparator()
        filemenu.Append(wx.ID_EXIT, "Exit", "Terminate the program")
#SETTINGS MENU ITEMS
        settingsmenu = wx.Menu()
        settingsmenu.Append(wx.ID_ABOUT,"Settings","Software settings")
        settingsmenu.AppendSeparator()
        settingsmenu.Append(8,"&Options","Options")
#HELP MENU ITEMS
        helpmenu = wx.Menu()
        helpmenu.Append(wx.ID_ABOUT,"Help tutorial","Get started with tutorial")
        helpmenu.AppendSeparator()
        helpmenu.Append(7,"About","About this software")

#MENUBAR
        menuBar = wx.MenuBar()
        menuBar.Append(filemenu, "&File");
        menuBar.Append(settingsmenu, "&Settings")
        menuBar.Append(helpmenu, "&Help")
        self.SetMenuBar(menuBar)
               
# FIRST VERTICAL BOX - adding boxes on top of each other, we need two boxes - one for toolbar and other for panels

        vbox = wx.BoxSizer(wx.VERTICAL)

# HBOX- which will contain toolbar and its buttons

        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
        imageFileadd = "Add.jpg"
        image1 = wx.Image(imageFileadd, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        imageFileback = "Back.jpg"
        image2 = wx.Image(imageFileback, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        imageFileforward = "Forward.jpg"
        image3 = wx.Image(imageFileforward, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        imageFiledelete = "Exit.jpg"
        image4 = wx.Image(imageFiledelete, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        imageFilecheck = "Check.jpg"
        image5 = wx.Image(imageFilecheck, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        imageFileprinter = "Printer.jpg"
        image6 = wx.Image(imageFileprinter, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        imageFilepadlock = "Lock.jpg"
        image7 = wx.Image(imageFilepadlock, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        imageFilesave = "Help.jpg"
        image8 = wx.Image(imageFilesave, wx.BITMAP_TYPE_ANY).ConvertToBitmap()


        btnnew = wx.BitmapButton(panel, -1, bitmap = image1, size=(image1.GetWidth()+5, image1.GetHeight()+5))
        btnback = wx.BitmapButton(panel, -1, bitmap = image2, size=(image1.GetWidth()+5, image1.GetHeight()+5))
        btnforward= wx.BitmapButton(panel, -1, bitmap = image3, size=(image1.GetWidth()+5, image1.GetHeight()+5))
        btndelete = wx.BitmapButton(panel, -1, bitmap = image4, size=(image1.GetWidth()+5, image1.GetHeight()+5))
        btncheck = wx.BitmapButton(panel, -1, bitmap = image5, size=(image1.GetWidth()+5, image1.GetHeight()+5))
        btnprinter = wx.BitmapButton(panel, -1, bitmap = image6,  size=(image1.GetWidth()+5, image1.GetHeight()+5))
        btnpadlock = wx.BitmapButton(panel, -1, bitmap = image7, size=(image1.GetWidth()+5, image1.GetHeight()+5))
        btnsave = wx.BitmapButton(panel, -1, bitmap = image8, size=(image1.GetWidth()+5, image1.GetHeight()+5))

       
        hbox1.Add(btnnew, 0, wx.RIGHT, 8)
        hbox1.Add(btnsave, 0, wx.RIGHT, 8)
        hbox1.Add(btnback, 0, wx.RIGHT, 8)
        hbox1.Add(btnforward, 0, wx.RIGHT, 8)
        hbox1.Add(btndelete, 0, wx.RIGHT, 8)
        hbox1.Add(btnpadlock, 0, wx.RIGHT, 8)
        hbox1.Add(btncheck, 0, wx.RIGHT, 8)
        hbox1.Add(btnprinter, 0, wx.RIGHT, 8)
        

# ADD HBOX1 i.e toolbar to vertical box.

        vbox.Add(hbox1, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 10)
        vbox.Add((-1, 10))

# CREATE  SPLITTER WINDOW  and add to vertical box        

        splitter = wx.SplitterWindow(panel, -1)
        vbox.Add(splitter, 1, wx.EXPAND | wx.ALL )

# CREATE TWO PANELS, within the splitter window

        leftpanel= wx.Panel(splitter, -1, size = (800,400))
        rightpanel = wx.Panel(splitter, -1)
        leftpanel.SetBackgroundColour('blue')
        rightpanel.SetBackgroundColour('red')
        splitter.SplitVertically(leftpanel, rightpanel,600)
        splitter.SetSashGravity(0.7)
        splitter.SetSashSize(4)
   
# Lets work on left panel, we build two top and bottom panes --  lefttop and leftbottom panes
        vboxleft = wx.BoxSizer(wx.VERTICAL)
                
        leftsplitter = wx.SplitterWindow(leftpanel, -1)
        vboxleft.Add(leftsplitter, 1, wx.EXPAND | wx.ALL)
        
        lefttop = wx.Panel(leftsplitter, -1)
        leftbottom = wx.Panel(leftsplitter)

                
        lefttop.SetBackgroundColour('green')
        leftbottom.SetBackgroundColour('blue')
        leftsplitter.SplitHorizontally(lefttop,leftbottom,155)


        leftpanel.SetSizer(vboxleft)                

# Now lets create two panes in lefttop pane - topleft and topright
        hboxtop=wx.BoxSizer(wx.HORIZONTAL)
                
        topsplitter=wx.SplitterWindow(lefttop, -1)

        topleft =wx.Panel(topsplitter, -1, size=(300,100))
        topright = wx.Panel(topsplitter, -1)

        topleft.SetBackgroundColour('black')
        topright.SetBackgroundColour('gray')        

        topsplitter.SplitVertically(topleft,topright)
        hboxtop.Add(topsplitter, 1, wx.EXPAND | wx.ALL)
        topsplitter.SetSashGravity(0.6)
        lefttop.SetSizer(hboxtop)

        welcome ='   Howdy! Welcome to Project N! \n Dr.Naimath >>> Please enter the presenting symptoms \n You >>> '  
        stext = wx.StaticText(topleft, -1, welcome)
        stext.SetForegroundColour("white")        

# Now lets add something in left bottom pane (leftbottom panel)

        nb = wx.Notebook(leftbottom, -1, style=wx.NB_TOP)        
        
        general=wx.Panel(nb)
        cvs=wx.Panel(nb)
        git = wx.Panel(nb)
        resp = wx.Panel(nb)
        renal = wx.Panel(nb)
        endo = wx.Panel(nb)
        dermat = wx.Panel(nb)
        rheum = wx.Panel(nb)
        cns = wx.Panel(nb)
        infect = wx.Panel(nb)
        paeds = wx.Panel(nb)
        obg = wx.Panel(nb)
        surgery = wx.Panel(nb)
        psych = wx.Panel(nb)


        nb.AddPage(general,"General")
        nb.AddPage(cvs,"CVS")
        nb.AddPage(git,"GIT")
        nb.AddPage(resp,"Respiratory")
        nb.AddPage(cns,"CNS")
        nb.AddPage(renal,"Renal")
        nb.AddPage(endo,"Endocrine")
        nb.AddPage(rheum,"Rheum")
        nb.AddPage(dermat,"Dermatology")
        nb.AddPage(infect,"Infectious")
        nb.AddPage(psych,"Psychiatry")
        nb.AddPage(paeds,"Paediatrics")
        nb.AddPage(surgery,"Surgical")
        nb.AddPage(obg,"OBG/GYN")

        general.SetFocus()


        vboxdown=wx.BoxSizer(wx.VERTICAL)
        vboxdown.Add(nb,1,wx.EXPAND)
        leftbottom.SetSizer(vboxdown)

    # Lets work on General Tab

        gbox=wx.BoxSizer(wx.VERTICAL)
        
        general_gs = wx.BoxSizer(wx.HORIZONTAL)

        cb = wx.CheckBox(general, -1, 'Headache')
        general_gs.Add(cb)

        cb1 = wx.CheckBox(general, -1, 'Associated with nitrates')
        general_gs.Add(cb1)

        cb2 = wx.CheckBox(general, -1, 'Unilateral/ Bilateral')
        general_gs.Add(cb2)

        cb3 = wx.CheckBox(general, -1, 'Throbbing')
        general_gs.Add(cb3)
        
        cb4 = wx.CheckBox(general, -1, 'Sharp')
        general_gs.Add(cb4)

        cb5 = wx.CheckBox(general, -1, 'Itching')
        general_gs.Add(cb5)

        cb6 = wx.CheckBox(general, -1, 'Itching')
        general_gs.Add(cb6)

        cb7 = wx.CheckBox(general, -1, 'Itching')
        general_gs.Add(cb7)

        cb8 = wx.CheckBox(general, -1, 'Itching')
        general_gs.Add(cb8)

        cb9 = wx.CheckBox(general, -1, 'Itching')
        general_gs.Add(cb9)











        wx.StaticLine(general, -1)

        general.SetSizer(gbox)
        gbox.Add(general_gs,1,wx.EXPAND)
# Lets work on right panel

        hbox4 = wx.BoxSizer(wx.HORIZONTAL)
        tc3 = wx.TextCtrl(rightpanel, -1, style=wx.TE_MULTILINE)
        hbox4.Add(tc3, 1, wx.EXPAND | wx.ALL, 5)    

        rightpanel.SetSizer(hbox4)

# Set sizer for main panel
        panel.SetSizer(vbox)

# Some lines for frame
        self.Centre()
        self.Show(True)

# Module runner
app = wx.App()
GoToClass(None, -1, 'Project N | Medical Expert System')
app.MainLoop()
